package com.thghh.client;

import com.tghhh.gkrpc.Peer;
import com.thghh.gkrpc.HttpTransportClient;
import com.thghh.gkrpc.TransportClient;
import com.thghh.gkrpc.codec.Decoder;
import com.thghh.gkrpc.codec.Encoder;
import com.thghh.gkrpc.codec.JSONDecoder;
import com.thghh.gkrpc.codec.JSONEncoder;
import lombok.Data;

import java.util.ArrayList;
import java.util.List;

/**
 * @author Zhikang.Peng
 * @version 1.0
 * @email thghh@qq.com
 * @date 2020/4/14 15:40
 */
@Data
public class RpcClientConfig {
    private Class<? extends TransportClient> transportClass = HttpTransportClient.class;
    private Class<? extends Encoder> encoderClass = JSONEncoder.class;
    private Class<? extends Decoder> decoderClass = JSONDecoder.class;
    private Class<? extends TransportSelector> selectorClass = RandomTransportSelector.class;
    private int connectCount = 1;
    private List<Peer> servers;

    {
        Peer peer = new Peer("127.0.0.1", 3000);
        servers = new ArrayList<>();
        servers.add(peer);
    }
}
